<template>
  <div class="content">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="薪酬档案" name="first">
        <salary-file></salary-file>
        </el-tab-pane>
      <el-tab-pane label="薪级档案" name="second">
          <salary-grade-file></salary-grade-file>
      </el-tab-pane>
      <el-tab-pane label="薪酬方案" name="third">
        <salary-scheme></salary-scheme>
      </el-tab-pane>
      <el-tab-pane label="薪级配置" name="fourth">
        <salary-grade-dispose></salary-grade-dispose>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import salaryFile from './salaryFile/salaryFile.vue' //薪酬档案
import salaryGradeDispose from './salaryGradeDispose/salaryGradeDispose.vue'   //薪级配置
import salaryGradeFile from './salaryGradeFile/salaryGradeFile.vue'   //薪级档案
import salaryScheme from './salaryScheme/salaryScheme.vue'   //薪酬方案
export default {
  components:{
    salaryFile,
    salaryGradeDispose,
    salaryGradeFile,
    salaryScheme
  },
  data() {
    return {
      activeName: "first",
      // tableData: [
      //   {
      //     id: "12987122",
      //     name: "王小虎",
      //     amount1: "234",
      //     amount2: "3.2",
      //     amount3: 10,
      //   },
      //   {
      //     id: "12987122",
      //     name: "王小虎",
      //     amount1: "234",
      //     amount2: "3.2",
      //     amount3: 10,
      //   },
      //   {
      //     id: "12987122",
      //     name: "王小虎",
      //     amount1: "234",
      //     amount2: "3.2",
      //     amount3: 10,
      //   },
      // ],
      // queryParams: {
      //   employeeCode: null,
      //   employeeName: null,
      //   employeeTel: null,
      //   employeeJoinStatus: null,
      //   employeeFormalStatus: null,
      //   employeeLeaveStatus: null,
      //   employeeRetiredStatus: null,
      //   current: 1, //当前页码
      //   size: 10, //每页显示数量
      // },
      // grades: [
      //   {
      //     gradeCode: "教学类",
      //     gradeName: "教学单位正职",
      //     sort: "P1、P2",
      //   },
      //   {
      //     gradeCode: "管理类",
      //     gradeName: "教授",
      //     sort: "P1、P2、P3",
      //   },
      // ],
    };
  },
  methods: {
    handleClick(tab, event) {
      let name = tab.name;
      switch (name) {
        case "holdPost":
          this.queryParams.employeeStatus = "2";
          this.tableCols = [
            {
              prop: "employeeName",
              label: "中文姓名",
              show: true,
              disable: false,
            },
            { prop: "employeeCode", label: "工号", show: true, disable: false },
            {
              prop: "employeeStatus",
              label: "转正状态",
              show: true,
              disable: false,
            },
            { prop: "postName", label: "岗位名称", show: true, disable: false },
            {
              prop: "postTypeName",
              label: "岗位类别",
              show: true,
              disable: false,
            },
            {
              prop: "gradeName",
              label: "岗位职级",
              show: true,
              disable: false,
            },
            {
              prop: "organizationName",
              label: "直属组织",
              show: true,
              disable: false,
            },
            {
              prop: "employeeEmployType",
              label: "雇佣性质",
              show: true,
              disable: false,
            },
            {
              prop: "employeeInHeadship",
              label: "编制类型",
              show: true,
              disable: false,
            },
            {
              prop: "employeeGender",
              label: "性别",
              show: true,
              disable: false,
            },
            { prop: "age", label: "年龄", show: true, disable: false },
            {
              prop: "employeeTel",
              label: "手机号",
              show: true,
              disable: false,
            },
          ];
          break;
        case "leave":
          this.queryParams.employeeStatus = "3";
          this.tableCols = [
            {
              prop: "employeeName",
              label: "中文姓名",
              show: true,
              disable: false,
            },
            { prop: "employeeCode", label: "工号", show: true, disable: false },
            { prop: "postName", label: "岗位名称", show: true, disable: false },
            {
              prop: "postTypeName",
              label: "岗位类别",
              show: true,
              disable: false,
            },
            {
              prop: "gradeName",
              label: "岗位职级",
              show: true,
              disable: false,
            },
            {
              prop: "organizationName",
              label: "直属组织",
              show: true,
              disable: false,
            },
            {
              prop: "employeeEmployType",
              label: "雇佣性质",
              show: true,
              disable: false,
            },
            {
              prop: "employeeInHeadship",
              label: "编制类型",
              show: true,
              disable: false,
            },
            {
              prop: "employeeGender",
              label: "性别",
              show: true,
              disable: false,
            },
            { prop: "age", label: "年龄", show: true, disable: false },
            {
              prop: "employeeJoinTime",
              label: "入职日期",
              show: true,
              disable: false,
            },
            {
              prop: "employeeLeaveTime",
              label: "离职日期",
              show: true,
              disable: false,
            },
            {
              prop: "employeeLeaveType",
              label: "离职类型",
              show: true,
              disable: false,
            },
          ];
          break;
        case "retired":
          this.queryParams.employeeStatus = "4";
          this.tableCols = [
            {
              prop: "employeeName",
              label: "中文姓名",
              show: true,
              disable: false,
            },
            { prop: "employeeCode", label: "工号", show: true, disable: false },
            { prop: "postName", label: "岗位名称", show: true, disable: false },
            {
              prop: "postTypeName",
              label: "岗位类别",
              show: true,
              disable: false,
            },
            {
              prop: "gradeName",
              label: "岗位职级",
              show: true,
              disable: false,
            },
            {
              prop: "organizationName",
              label: "直属组织",
              show: true,
              disable: false,
            },
            {
              prop: "employeeEmployType",
              label: "雇佣性质",
              show: true,
              disable: false,
            },
            {
              prop: "employeeInHeadship",
              label: "编制类型",
              show: true,
              disable: false,
            },
            {
              prop: "employeeGender",
              label: "性别",
              show: true,
              disable: false,
            },
            { prop: "age", label: "年龄", show: true, disable: false },
            {
              prop: "employeeJoinTime",
              label: "入职日期",
              show: true,
              disable: false,
            },
            {
              prop: "employeePlanLeaveTime",
              label: "计退休日期",
              show: true,
              disable: false,
            },
            {
              prop: "employeeRetiredTime",
              label: "办理日期",
              show: true,
              disable: false,
            },
          ];
          break;
        default:
          this.queryParams.employeeStatus = "2";
          this.tableCols = [
            {
              prop: "employeeName",
              label: "中文姓名",
              show: true,
              disable: false,
            },
            { prop: "employeeCode", label: "工号", show: true, disable: false },
            {
              prop: "employeeStatus",
              label: "转正状态",
              show: true,
              disable: false,
            },
            { prop: "postName", label: "岗位名称", show: true, disable: false },
            {
              prop: "postTypeName",
              label: "岗位类别",
              show: true,
              disable: false,
            },
            {
              prop: "gradeName",
              label: "岗位职级",
              show: true,
              disable: false,
            },
            {
              prop: "organizationName",
              label: "直属组织",
              show: true,
              disable: false,
            },
            {
              prop: "employeeEmployType",
              label: "雇佣性质",
              show: true,
              disable: false,
            },
            {
              prop: "employeeInHeadship",
              label: "编制类型",
              show: true,
              disable: false,
            },
            {
              prop: "employeeGender",
              label: "性别",
              show: true,
              disable: false,
            },
            { prop: "age", label: "年龄", show: true, disable: false },
            {
              prop: "employeeTel",
              label: "手机号",
              show: true,
              disable: false,
            },
          ];
          break;
      }
      this.getPageList();
    },
    clickReset() {
      this.reset = !this.reset;
    },
    resetQuery() {
      this.queryParams = {
        employeeCode: null,
        employeeName: null,
        employeeTel: null,
        employeeStatus: "2",
        size: 10,
        current: 1,
      };
      this.getPageList();
    },
    // 翻页
    handleCurrentChange(val) {
      this.queryParams.current = val;
      this.getPageList();
    },
  },
};
</script>
<style scoped>
.el-table {
  margin-top: 20px;
}
.el-tabs {
  margin: 0 20px;
}
.el-tabs__item {
  font-size: 16px;
  font-weight: bold;
}
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 12px;
}
.chance {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.context {
  padding-left: 20px;
}
.select{
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.select .el-dropdown-link {
  color: black;
  border: 1px solid #ccc;
  padding: 10px;
  margin-right: 20px;
  border-radius: 5px;
}
.el-date-editor{
  width: 120px;
  margin-right: 20px;
}
</style>